#include "userdef.h"
void task_setup(uint8_t id,int32_t ntick);

INTERRUPT(UART1_Routine, EXTI_VectUART1)
{
  UART1_InterruptHandler();
}


void main(void)
{
	task_init();
	UART1_Config8bitUart(UART1_BaudSource_Timer2, HAL_State_ON, 115200);
	UART1_SetRxState(HAL_State_ON);
	EXTI_UART1_SetIntState(HAL_State_ON);
	motor_init();
  IAP_SetWaitTime();	
	task_get(task_setup);
	delay_nms(3000);
	UART1_TxString("SysClock:");
	debug_u32(SYS_GetSysClock());
	UART1_TxString("\r\n");
	systick_init();
	for(;;){
		task_exec();
	}
}
